package com.naiterui.ehp.bs.doctor.dao.impl;

import com.naiterui.ehp.bp.domain.DrChargeConfig;
import com.naiterui.ehp.bs.doctor.dao.IDrChargeConfigDao;
import com.naiterui.ehp.bs.doctor.repository.IDrChargeConfigRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 医生收费标准配置信息持久化接口实现
 *
 * @author Amber
 * @since 1.0.0
 */
@Repository
public class AdDrChargeConfigDaoImpl  implements
        IDrChargeConfigDao {

    @Autowired
    private IDrChargeConfigRepository drChargeConfigRepository;

    @Override
    public DrChargeConfig getChargeConfigByTypeAndTitle(int type, int title) {
        List<DrChargeConfig> chargeConfigs = drChargeConfigRepository.findByTypeAndDoctorTitle(type, title);
        return chargeConfigs.size() == 0 ? null : chargeConfigs.get(0);
    }

}
